package com.cn.mapper;

import com.cn.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User userLogin(@Param("accountNumber") String accountNumber, @Param("userPassword") String userPassword);

    User selectByPrimaryKey(Long id);

    List<User> getUserList();

    List<User> getNormalUser(@Param("begin") int begin, @Param("nums") int nums);

    // 新增方法，用于PageHelper分页
    List<User> getNormalUserForPage();

    List<User> getBanUser(@Param("begin") int begin, @Param("nums") int nums);

    // 新增方法，用于PageHelper分页
    List<User> getBanUserForPage();

    int countNormalUser();

    int countBanUser();

    List<User> getUserByNumber(@Param("searchValue") String searchValue, @Param("begin") int begin, @Param("nums") int nums);

    // 新增方法，用于PageHelper分页
    List<User> getUserByNumberForPage(@Param("searchValue") String searchValue);

    int countUserByNumber(@Param("searchValue") String searchValue);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    int updatePassword(@Param("newPassword") String newPassword, @Param("oldPassword") String oldPassword, @Param("id") Long id);

    List<User> findUserByList(@Param("idList") List<Long> idList);
}
